<template>
  <div>
    <p><input type="text" v-model="fn"></p>
    <p><input type="text" v-model="ln"></p>
    {{ fullname }}
    <p><input type="text" v-model="fullname"></p>
    <p>
        <input type="text" v-model.number="msg">
    </p>
    <p>
      <span>数据的类型是:{{typeof(msg)}}</span>
    </p>
  </div>
</template>

<script>

export default {
    data(){
        return{
            fn:'',
            ln:'',
            msg:''
            
        }
    },
    computed:{
        fullname:{
            get(){
                return this.fn+'-'+this.ln
            },
            set(value){
                let arr = value.split('-');
                this.fn = arr[0];
                this.ln = arr[1]
            }
        }
    }
}
</script>
<style scoped>
.red{
    color:red;
}
.weight{
    font-weight: bold;
}
</style>